package com.iteaj.util.json;

import java.util.ArrayList;
import java.util.Iterator;

/**
 * create time: 2018/9/20
 *
 * @author iteaj
 * @since 1.0
 */
public interface JsonArray {

    <T> T original();

    int size();

    String toJsonString();

    Json getJson(int index);

    <E> Iterator<E> iterator();

    JsonArray getJsonArray(int index);

    /**
     * @param arrayType eg: Integer[].class
     * @param <T> eg: Integer[]
     * @return eg: [2,3,4]
     */
    <T> T toArray(Class<T> arrayType);

    <T> ArrayList<T> toList(Class<T> eleType);
}
